package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.OrderAccountInfoMapper;
import com.aidex.biz.domain.OrderAccountInfo;
import com.aidex.biz.service.OrderAccountInfoService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 订单账户信息Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2022-11-09
 */
@Service
@Transactional(readOnly = true)
public class OrderAccountInfoServiceImpl extends BaseServiceImpl<OrderAccountInfoMapper, OrderAccountInfo> implements OrderAccountInfoService
{
    private static final Logger log = LoggerFactory.getLogger(OrderAccountInfoServiceImpl.class);

    /**
     * 获取单条数据
     * @param orderAccountInfo 订单账户信息
     * @return 订单账户信息
     */
    @Override
    public OrderAccountInfo get(OrderAccountInfo orderAccountInfo)
    {
        OrderAccountInfo dto = super.get(orderAccountInfo);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 订单账户信息id
     * @return 订单账户信息
     */
    @Override
    public OrderAccountInfo get(String id)
    {
        OrderAccountInfo dto = super.get(id);
        return dto;
    }


    /**
     * 查询订单账户信息列表
     * @param orderAccountInfo 订单账户信息
     * @return 订单账户信息
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<OrderAccountInfo> findList(OrderAccountInfo orderAccountInfo)
    {
        return super.findList(orderAccountInfo);
    }

    /**
     * 分页查询订单账户信息列表
     * @param orderAccountInfo 订单账户信息
     * @return 订单账户信息
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<OrderAccountInfo> findPage(OrderAccountInfo orderAccountInfo)
    {
        return super.findPage(orderAccountInfo);
    }

    /**
     * 保存订单账户信息
     * @param orderAccountInfo
     * @return 结果
     */
    @Override
    public boolean save(OrderAccountInfo orderAccountInfo)
    {
        return super.save(orderAccountInfo);
    }


    /**
     * 删除订单账户信息信息
     * @param orderAccountInfo
     * @return 结果
     */
    @Override
    public boolean remove(OrderAccountInfo orderAccountInfo)
    {
        return super.remove(orderAccountInfo);
    }

    /**
     * 批量删除订单账户信息
     * @param ids 需要删除的订单账户信息ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteOrderAccountInfoByIds(String[] ids)
    {
        return mapper.deleteOrderAccountInfoByIds(ids);
    }

    /**
     * 获取最大编号
     * @param orderAccountInfo 订单账户信息
     * @return 结果
     */
    @Override
    public int findMaxSort(OrderAccountInfo orderAccountInfo)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(orderAccountInfo));
    }
}
